<?php


/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

//Route::middleware('auth:api')->get('/user', function (Request $request) {
//    return $request->user();
//});


Route::group(['middleware' => 'api'], function () {
    Route::post('/login', 'Auth\AuthController@login');
    Route::get('/webmaster', 'Auth\UserController@webmaster');
    Route::post('/upload/image', 'Base\FileController@upload');
    Route::get('/user', 'Auth\UserController@user');
    Route::post('/user', 'Auth\UserController@update')->middleware('auth:api');

    Route::get('/blog', 'Blog\BlogController@list');
    Route::post('/blog', 'Blog\BlogController@create')->middleware('auth:api');
    Route::post('/blog/switch', 'Blog\BlogController@switch')->middleware('auth:api');
    Route::get('/blog/detail', 'Blog\BlogController@detail');
    Route::get('/blog/search', 'Blog\BlogController@search');
    Route::post('/blog/like', 'Blog\BlogController@like');

    Route::get('/categoty', 'Category\CategoryController@list');
    Route::post('/categoty', 'Category\CategoryController@create')->middleware('auth:api');
    Route::delete('/categoty', 'Category\CategoryController@delete')->middleware('auth:api');

    Route::post('/skill', 'Skill\SkillController@create')->middleware('auth:api');
    Route::get('/skill', 'Skill\SkillController@list');
    Route::post('/skill/switch/{skill}', 'Skill\SkillController@switch')->middleware('auth:api');

    Route::post('/exp', 'Exp\ExpController@create')->middleware('auth:api');
    Route::get('/exp', 'Exp\ExpController@list');
    Route::post('/exp/switch/{exp}', 'Exp\ExpController@switch')->middleware('auth:api');



});

